package com.example.smartcity_poverty.ui.AllService.LogisticsQuery.adapter

import com.example.smartcity_poverty.App.Companion.url
import com.example.smartcity_poverty.Base.BaseRecyclerAdapter
import com.example.smartcity_poverty.logic.ServiceBean.LogisticsQueryBean.LqMoreModel
import com.example.smartcity_poverty.logic.util.Util.glide
import kotlinx.android.synthetic.main.re_lq_item_list.*

/**
 *  created by ikun
 *  ANDROID STUDIO - version 4.0
 *  email: jinkunwei41@gmail.com
 * --------------------------------
 *
 **/
class LqListAdapter(
    val list: MutableList<LqMoreModel.DataBean>,
    layoutId: Int
) : BaseRecyclerAdapter<LqMoreModel.DataBean>(list, layoutId) {
    override fun setData(
        view: BaseViewHolder.ViewFind,
        data: LqMoreModel.DataBean,
        position: Int,
        holder: BaseViewHolder
    ) {
        list.sortBy { it -> it.name }

        val d = list[position]
        val con = holder.viewFind.view?.context

        glide(url + d.imgUrl, view.lqListImage)
        view.lqListTitle.text = d.name


    }
}